<include file="public:header" />
<include file="public:left" />
<div style="float:left;width:100%">
    <button style="margin-left:5%" class="btn btn-primary goodsShow"  >添加字段</button>
    <br>
    <br>
    <form action="{:U($class.'/fieldSuccess')}" method="post" id="form1" class="registerform"  >
        <div  style="width:100%">
            <table id="sample-table-1" class="table table-striped table-bordered table-hover wrfont14" style="width:90%;margin-left:5%">
                <thead>
                <tr>
                    <th>操作</th>
                    <th>字段名称</th>
                    <th>字段</th>
                    <th>字段类型</th>
                    <th>长度位数</th>
                    <th>小数点位数</th>
                    <th>备注</th>
                </tr>
                </thead>
                <tbody id="content"></tbody>
                <input type="hidden" name="id" value="{$id}" >
            </table>
        </div>
        <button  style="margin-left:5%"  type="submit" class="btn btn-primary">保存并生成</button>
    </form>
</div>
<script>
    $(function(){
        $(".goodsShow").click(function() {
             var html = '<tr><td><a style="margin-left:5%" class="btn btn-danger goodsDel">删除</a></td>'+
                        '<td><input  class="form-control" type="text" name="name[]"></td>'+
                        '<td><input  class="form-control" type="text" name="field[]"></td>'+
                        '<td><select class="form-control " name="type[]">' +
                         <volist name="type_list" id="val" >
                        '<option value="{$val}">{$val}</option>>' +
                        </volist>
                     '</select></td>'+
                        '<td><input  class="form-control" type="text" name="len[]"></td>'+
                        '<td><input  class="form-control" type="text" name="decimal[]"></td>'+
                        '<td><input  class="form-control" type="text" name="remark[]"></td></tr>';
            $("#content").append(html);

        });
        $(document).on("click",".goodsDel",function(){
           $(this).parent().parent().remove();
        });
    })
</script>
<include file="public:footer" />
